package com.someclip.component.controlls
{
	import com.someclip.component.core.Component;
	import com.someclip.component.interfaces.IButton;
	import com.someclip.component.skins.DefaultButtonSkin;
	import flash.events.Event;

	/**
	 * ...
	 * @author ...
	 */
	public class Button extends BaseButton implements IButton
	{
		private var _labelIns:Label;
		private var _label:String;

		public function Button()
		{
			this.width=75;
			this.height=20;
//			this.styleLink=new DefaultButtonSkin();
			_labelIns=new Label();
			_labelIns.text="Button";
			_labelIns.selectAble=false;
			_labelIns.width=75;
			_labelIns.height=20;
			_labelIns.textAlign="center";
			_labelIns.mouseChildren=false;
			_labelIns.mouseEnabled=false;
			_labelIns.vCenter=0;
			_labelIns.hCenter=0;
			addChild(_labelIns);
		}

		override public function set width(value:Number):void
		{
			super.width=value;
			if (_labelIns)
			{
				_labelIns.width=this.width;
			}
		}

		override public function set height(value:Number):void
		{
			super.height=value;
//			if (_labelIns)
//			{
//				_labelIns.height=this.height;
//			}
		}

		public function get label():String
		{
			return _label;
		}

		public function set label(value:String):void
		{
			_label=value;
			_labelIns.text=_label;
		}

		/**
		 * 获取字体大小
		 * @return
		 *
		 */
		public function get fontSize():uint
		{
			return _labelIns.fontSize;
		}

		/**
		 * 设置字体大小
		 * @param value
		 *
		 */
		public function set fontSize(value:uint):void
		{
			_labelIns.fontSize=value;

		}

		/**
		 * 获取字体加粗
		 * @return 布尔值
		 *
		 */
		public function get fontWeight():Boolean
		{
			return _labelIns.fontWeight;
		}

		/**
		 * 设置字体加粗
		 * @param value Boolean
		 *
		 */
		public function set fontWeight(value:Boolean):void
		{
			_labelIns.fontWeight=value;
		}

		/**
		 * 获取字体颜色
		 * @return
		 *
		 */
		public function get fontColor():uint
		{
			return _labelIns.fontColor;
		}

		/**
		 * 设置字体颜色
		 * @param value
		 *
		 */
		public function set fontColor(value:uint):void
		{
			_labelIns.fontColor=value;
		}

		/**
		 * 获取文本对齐方式
		 * @return
		 *
		 */
		public function get textAlign():String
		{
			return _labelIns.textAlign;
		}

		/**
		 * 设置文本对齐方式
		 * @param value
		 *
		 */
		public function set textAlign(value:String):void
		{
			_labelIns.textAlign=value;
		}
	}

}
